Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vtex-node-sdk

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vtex-node-sdk

VTEX SDK for Node.js

  • 0.5.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

vtex-node-sdk

A VTEX Node.js SDK.

Installation:

npm install --save vtex-node-sdk

Logger

VTEX Log4js wrapper

var Logger = require('vtex-node-sdk').Logger

var loggerConfig = {
  type: 'console',
  category: 'myCategory',
  verbose: true
}

var logger = Logger(loggerConfig).getLogger()

Logger will receive different log levels based on some configs: verbose option will set the log level to INFO. debugMode will set the log level to DEBUG. Any logging will be disabled if the NODE_ENV is set to test

License Manager Client

http://licensemanager.vtex.com.br

LicenseManagerClient([lmEnvironment])

Client for the License Manager service. If no lmEnvironment paramenter is passed, the stable service will be used.

var LicenseManagerClient = require('vtex-node-sdk').LicenseManagerClient
var lmClient = new LicenseManagerClient()

getAccountDetails

GET /api/license-manager/pvt/accounts/hosts/:host

getAccountDetails(host, vtexIdclientAutCookie)

Returns a promise fulfilling an array with the response and the body object of the request.

var vtexIdclientAutCookie =  "authtokenvalue=="

lmClient.getAccountDetails("www.basedevmkp.com.br", vtexIdclientAutCookie)
.spread(function(response, body){
    console.log(body.MainAccountName)
})
.catch(function(err){
    console.error(err)
})

getTopbarInfo

GET /api/license-manager/site/pvt/newtopbar?an=:account

getTopbarInfo(account, vtexIdclientAutCookie)

Returns a promise fulfilling an array with the response and the body object of the request

var vtexIdclientAutCookie =  "authtokenvalue=="

lmClient.getAccountDetails("basedevmkp", vtexIdclientAutCookie)
.spread(function(response, body){
    console.log(body.config)
})
.catch(function(err){
    console.error(err)
})

IAM Client

https://iam.vtex.com

IAMClient()

Client for the IAM service.

var IAMClient = require('vtex-node-sdk').IAM
var iam = new IAMClient()

getVtexAuthToken

POST /sts/tokens/assumerole/vtexid

Payload example:

{
    "account": "basedevmkp",
    "token": "vtexIdclientAutCookieToken=="
}

getVtexAuthToken(account, vtexIdclientAutCookie)

Returns a promise that fullfils an array with the response and a token string

var vtexIdClientAutCookie = "1234vtexidtoken=="

iam.getVtexAuthToken("basedevmkp", vtexid)
.spread(function(response, token){
    console.log(token)
})
.catch(function(err){
    console.error(err)
})

VTEX API Token

S3 GET vtex-id/tokens/vtex-id/tokens/vtexappkey-appvtex.json

Returns app key from S3. Needs valid AWS credentials.

FAQs

Package last updated on 09 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc